package com.plian.system.vo.sys;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.plian.system.entity.sys.ServiceOrgFormType;
import com.plian.system.node.INode;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.ArrayList;
import java.util.List;


@Data
@EqualsAndHashCode(callSuper = true)
public class ServiceOrgFormTypeVO extends ServiceOrgFormType implements INode<Long, ServiceOrgFormTypeVO> {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("是否已选 0否1是")
    private Integer isChecked;

    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    @ApiModelProperty(value = "子孙节点")
    private List<ServiceOrgFormTypeVO> children;

    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    @ApiModelProperty(value = "是否有子孙节点")
    private Boolean hasChildren;

    @Override
    public List<ServiceOrgFormTypeVO> getChildren() {
        if (this.children == null) {
            this.children = new ArrayList<>();
        }
        return this.children;
    }

}
